import java.sql.*;
public class Test1 {
    public static void main(String args[]) {
        Connection con=null;
        Statement sql;
        ResultSet rs;
        try{  Class.forName("com.mysql.jdbc.Driver"); //加载JDBC_MySQL驱动
        }
        catch(Exception e){}
        String uri = "jdbc:mysql://localhost:3306/world?useSSL=true";
        String user ="root";
        String password ="";
        try{
            con = DriverManager.getConnection(uri,user,password); //连接代码
        }
        catch(SQLException e){ }
        try {
            String c1=" Population>6016532";
            String sqlStr="select * from city where "+c1+"";
            sql=con.createStatement();
            rs=sql.executeQuery(sqlStr);
            while(rs.next()) {
                String Name=rs.getString(2);
                String CountryCode=rs.getString(3);
                String District=rs.getString(4);
                String Population=rs.getString(5);
                System.out.printf("%s\t",Name);
                System.out.printf("%s\t",CountryCode);
                System.out.printf("%s\t",District);
                System.out.printf("%s\n",Population);
            }
            con.close();
        }
        catch(SQLException e) {
            System.out.println(e);
        }
    }
}
